版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/09/19/2013-09-19-CODE 20 Path Sum II/
访问原文「CODE 20. Path Sum II」
|
|
Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum.
For example:
Given the below binary tree and sum = 22
, 5
/ \
4 8
/ / \
11 13 4
/ \ / \
7 2 5 1
return
[
[5,4,11,2],
[5,8,4,5]
]